<!DOCTYPE html>
<html lang="zh-Hans-CN">
<head>
    <meta charset="UTF-8">
    <title>绑定样式:绑定类样式</title>
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <style>
        .box {
            background-color: pink;
            width: 100%;
            height: 200px;
        }

        .inner {
            background-color: red;
            width: 100px;
            height: 50px;
            border: 2px solid white;
        }
    </style>
    <script src="../vue.js"></script>
</head>
<body>
<h2>【例9】绑定样式:绑定类样式 v-bind:class="{类名-data变量名-变量值--一致}"</h2>
<hr>
<div id="app">
    <div v-bind:class="{box}">我是box
        <div v-bind:class="{inner}">我是inner1</div>
        <br>
        <div v-bind:class="{inner}">我是inner2</div>
    </div>
</div>
<script>
    let vm = new Vue({
        el: '#app',
        data: {
            box: 'box',
            inner: 'inner'
        }
    })
</script>
<hr>
<p><a href="index.html">返回章节目录</a>
    <script>document.write(document.lastModified); </script>
</p>
</body>
</html>
